package com.example.mobile2021606145zbq0324homework;

import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity{

    @Override
    protected void onCreate(Bundle savedlnstanceState) {
        super.onCreate(savedlnstanceState);
        setContentView(R.layout.activity_main);

        TextView textView = (TextView)findViewById(R.id.tv_main_title);
        EditText edt_main_title = (EditText)findViewById(R.id.edt_main_title);
        EditText edt_main_psw1 = (EditText)findViewById(R.id.edt_main_psw1);
        EditText edt_main_psw2 = (EditText)findViewById(R.id.edt_main_psw2);
        EditText edt_main_psw3 = (EditText)findViewById(R.id.edt_main_psw3);
        Button btn = (Button)findViewById(R.id.btn);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                switch (v.getId()) {
                    case R.id.btn:
                        if (edt_main_title.getText().toString().equals("Timi") &
                                edt_main_psw1.getText().toString().equals("666666"))
                            new AlertDialog.Builder(MainActivity.this)
                                    .setTitle("登录信息")
                                    .setMessage("密码修改成功")
                                    .setPositiveButton("确定", null)
                                    .create()
                                    .show();
                        break;
                }
            }
        });
        };
}
